{% extends "base_petadmin.html" %}

{% block mainheading %}{{ block.super }} \ Approve import{% endblock %}

{% block content %}

    <h3>Do you want to delete old and to import {{ tracks|length }} Track records ({{ tracktype|capfirst }})?</h3>
    <form action="." method="POST">
        {% csrf_token %}
        <input name="year" type="hidden" value="{{ year }}" />
        <input name="month" type="hidden" value="{{ month }}" />

        <input type="checkbox" value="1" name="confirm" />
        Confirm deletion of old Track records ({{ tracktype|capfirst }}) for {{ year }}-{{ month }}<br />

        <table>
            <thead>
                <tr>
                    <th>Date</th>
                    <th>CST</th>
                    <th>Direction</th>
                    <th>Entry</th>
                    <th>Exit</th>
                    {#<th>Point value</th>#}
                    {#<th>Trading P/L</th>#}
                    {#<th># Trades</th>#}
                </tr>
            </thead>
            {% for t in tracks %}
                <tr>
                    <td>{{ t.date }}</td>
                    <td>{{ t.cst_id.name }}</td>
                    <td>{{ t.direction_name }}</td>
                    <td>{{ t.entry_value }}</td>
                    <td>{{ t.exit_value }}</td>
                    {#<td>{{ t.get_point_value }} {{ t.get_currency_symbol|safe }}</td>#}
                    {#<td>{{ t.trading_profit_losses }}</td>#}
                    {#<td>{{ t.number_of_trades }}</td>#}
                </tr>
            {% empty %}
                <tr>
                    <td colspan="8">WTF?!</td>
                </td>
            {% endfor %}

            <tr>
                <td colspan="8"><input type="submit" class="default" value="Import" /></td>
            </tr>
        </table>

    </form>

{% endblock %}
